package com.longxi.tianjintianbao.model;

import com.contrarywind.interfaces.IPickerViewData;
import com.longxi.tianjintianbao.MyApplication;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class PropertyCompany implements IPickerViewData {
    private String IPID;
    private String IP;
    private String name;

    public PropertyCompany(String IPID, String IP, String name) {
        this.IPID = IPID;
        this.IP = IP;
        this.name = name;
    }

    public static List<PropertyCompany> getData(){
        List<PropertyCompany> propertyCompanies = MyApplication.propertyCompanieList;

        if(propertyCompanies != null){
            return propertyCompanies;
        }
        propertyCompanies = new ArrayList<>();
//        propertyCompanies.add(new PropertyCompany("1","http://122.112.213.120:9126/wyy_lywy/api/Interface/", "领域物业"));
//        propertyCompanies.add(new PropertyCompany("2","http://122.112.248.82:9126/wyy_ykmwy/api/Interface/", "凯迈物业"));
//        propertyCompanies.add(new PropertyCompany("0","http://117.78.44.159:8083/api/Interface/", "中节能(杭州)"));
//        propertyCompanies.add(new PropertyCompany("5","http://122.112.213.120:9126/wyy_nczjnwy/api/Interface/", "中节能(南昌)"));
        propertyCompanies.add(new PropertyCompany("3","http://192.168.1.66:801/api/Interface/", "天津天保"));
//        propertyCompanies.add(new PropertyCompany("3","http://122.112.207.114:9126/tjtbzcApp/api/Interface/", "天津天保"));
//        propertyCompanies.add(new PropertyCompany("4","http://192.168.66.66:9127/api/Interface/", "天保资产"));

        return propertyCompanies;
    }

    public static Map<String, PropertyCompany> getData2(){
        Map<String, PropertyCompany> propertyCompanieList2 = MyApplication.propertyCompanieList2;
        if(propertyCompanieList2 != null){
            return propertyCompanieList2;
        }
        propertyCompanieList2 = new HashMap<>();
//        propertyCompanieList2.put("1", new PropertyCompany("1","http://122.112.213.120:9126/wyy_lywy/api/Interface/", "领域物业"));
//        propertyCompanieList2.put("2", new PropertyCompany("2","http://122.112.248.82:9126/wyy_ykmwy/api/Interface/", "凯迈物业"));
//        propertyCompanieList2.put("0", new PropertyCompany("0","http://117.78.44.159:8083/api/Interface/", "中节能(杭州)"));
//        propertyCompanieList2.put("5", new PropertyCompany("5","http://122.112.213.120:9126/wyy_nczjnwy/api/Interface/", "中节能(南昌)"));
        propertyCompanieList2.put("3", new PropertyCompany("3","http://192.168.1.66:801/api/Interface/", "天津天保"));
//        propertyCompanieList2.put("3", new PropertyCompany("3","http://122.112.207.114:9126/tjtbzcApp/api/Interface/", "天津天保"));
//        propertyCompanieList2.put("4", new PropertyCompany("4","http://192.168.66.66:9127/api/Interface/", "天保资产"));

        return propertyCompanieList2;
    }

    public String getIPID() {
        return IPID;
    }

    public void setIPID(String IPID) {
        this.IPID = IPID;
    }

    public String getIP() {
        return IP;
    }

    public void setIP(String IP) {
        this.IP = IP;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String getPickerViewText() {
        return name;
    }
}
